package net.cyue.ort.llm.gui.config;

import java.nio.file.Path;

/**
 * 负责跟踪用户已选择的模型相关文件，并提供校验与快照功能，避免UI与加载逻辑互相依赖。
 */
public class SelectedModelFiles {

    private Path tokenizer;
    private Path tokenizerConfig;
    private Path config;
    private Path generationConfig;
    private Path model;

    public Path getTokenizer() {
        return tokenizer;
    }

    public void setTokenizer(Path tokenizer) {
        this.tokenizer = tokenizer;
    }

    public Path getTokenizerConfig() {
        return tokenizerConfig;
    }

    public void setTokenizerConfig(Path tokenizerConfig) {
        this.tokenizerConfig = tokenizerConfig;
    }

    public Path getConfig() {
        return config;
    }

    public void setConfig(Path config) {
        this.config = config;
    }

    public Path getGenerationConfig() {
        return generationConfig;
    }

    public void setGenerationConfig(Path generationConfig) {
        this.generationConfig = generationConfig;
    }

    public Path getModel() {
        return model;
    }

    public void setModel(Path model) {
        this.model = model;
    }

    public boolean isComplete() {
        return tokenizer != null
                && tokenizerConfig != null
                && config != null
                && generationConfig != null
                && model != null;
    }

    public SelectedModelFiles snapshot() {
        SelectedModelFiles copy = new SelectedModelFiles();
        copy.tokenizer = tokenizer;
        copy.tokenizerConfig = tokenizerConfig;
        copy.config = config;
        copy.generationConfig = generationConfig;
        copy.model = model;
        return copy;
    }

    public void clearConfigFiles() {
        tokenizer = null;
        tokenizerConfig = null;
        config = null;
        generationConfig = null;
    }
}

